<?php
$this->breadcrumbs=array(
	'Idealities'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'List Ideality', 'url'=>array('index')),
	array('label'=>'Create Ideality', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#ideality-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Manage Idealities</h1>

<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>



<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'ideality-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		array(
            'header'=>'No',
            'value'=>'$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)',
        ),
		'title',
		array(
			'name'=>'cate_id',
			'filter' => CHtml::listData(Category::model()->findAll(), 'id', 'title'), // fields from country table
            'value' => 'Category::Model()->FindByPk($data->cate_id)->title',
		),
		array(
			'name'=>'user_id',
			'filter' => CHtml::listData(User::model()->findAll(), 'id', 'username'), // fields from country table
            'value' => 'User::Model()->FindByPk($data->user_id)->username',
		),
		'code',
		'full_price',
		'partly_price',
		'short_description',
		'file_attach',
		array(
			'class'=>'CButtonColumn',
			 'htmlOptions' => array('style'=>'width:80px')
		),
	),
)); ?>
